package com.ruicar.afs.cloud.bizcommon.commission.feign;

import com.alibaba.fastjson.JSONObject;
import com.ruicar.afs.cloud.bizcommon.commission.dto.basecommission.DealerinfoDto;
import com.ruicar.afs.cloud.bizcommon.commission.dto.basecommission.GetbasecontractlistDto;
import com.ruicar.afs.cloud.bizcommon.commission.dto.discount.DiscountListDto;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.Description;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * @Description 佣金系统-贴息
 * @author yaorui.zhang
 * @version 1.0
 * @date create on 2020年6月8日 15:26:49
 * @since 1.0
 */
@FeignClient(name = "DiscountmainFeign",url = "${com.greatwall.systems.commission-system.url}")
public interface DiscountmainFeign {

    @Description("经销商查询下发的贴息数据")
    @PostMapping(value = "/discountmain/getlist")
    public JSONObject getlist(@RequestBody DiscountListDto dto, @RequestHeader Map<String, String> headers);

    @Description("经销店导出贴息的明细数据")
    @GetMapping (value = "/discountmain/exportRealse")
    Response exportRealse(@RequestParam("discountMainID") String discountMainID);

    @Description("经销商提获取回执模板")
    @GetMapping (value = "/discountmain/pdf")
    Response pdf(@RequestParam("id") String id);

    @Description("经销商上传回执文件 (上传附件)")
    @PostMapping(value = "/discountmain/uploadImage", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public JSONObject uploadImage(@RequestPart("file") MultipartFile file);

    @Description("经销商回执确认")
    @PostMapping(value = "/discountmain/confirm")
    public JSONObject confirm(@RequestBody JSONObject json);

    @Description("经销商查询下发的贴息数据详情")
    @PostMapping(value = "/discountmain/info",consumes = MediaType.APPLICATION_JSON_VALUE)
    public JSONObject info(@RequestBody DealerinfoDto dto);

    @Description("经销商查询下发的贴息数据详情-从表列表")
    @PostMapping(value = "/discountmain/discontlist",consumes = MediaType.APPLICATION_JSON_VALUE)
    public JSONObject discontlist(@RequestBody GetbasecontractlistDto dto);

}
